﻿using Minotaur.App.Domains.Model.Role;

namespace Minotaur.App.Domains.Model.Permission
{
    public class Permission : EntityBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(ColumnName = "autoid", IsIdentity = true, IsPrimaryKey = true)]
        public virtual long AutoId { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [SugarColumn(ColumnName = "percode")]
        public virtual string Percode { get; set; } = null!;

        /// <summary>
        /// 是否启用
        /// </summary>
        [SugarColumn(ColumnName = "enable")]
        public virtual bool? Enable { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [SugarColumn(ColumnName = "havedelete")]

        public virtual bool? HaveDelete { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sequence")]

        public virtual long? Sequence { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Navigate(typeof(RolePermission), nameof(RolePermission.PermissionId), nameof(RolePermission.RoleId))]//注意顺序
        public virtual List<RoleInfo> RoleInfos { get; set; }
    }
}
